package com.ylx.code.controller;

import com.ylx.code.bo.LoginBo;
import com.ylx.code.service.MarkAccountService;
import com.ylx.code.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * ClassName: AuthorController <br/>
 * Description: <br/>
 * date: 2023/11/17 16:01<br/>
 *
 * @author yanglixin<br />
 */
@Api(tags = "账号登录授权")
@Slf4j
@RestController
@RequestMapping("/auth")
public class AuthorController {

    @Autowired
    private MarkAccountService markAccountService;

    @ApiOperation(value = "账号登录")
    @PostMapping("/login")
    public Result<Map<String, Object>> login(@RequestBody @Validated LoginBo bo) {
        return Result.ok(markAccountService.login(bo));
    }
}
